package TCP;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author YuanYuan
 * @Date 2022/10/16
 * @Time 20:23
 */
public class TcpEchoTranslation extends TcpEchoSever{

    public Map<String,String> map = new HashMap<>();
    public TcpEchoTranslation(int port) throws IOException {
        super(port);

        map.put("刘一娴","yellowPig");
        map.put("马瑞","pinkDog");
        map.put("金德莉","whiteFoots");
        map.put("陈贞利","crazyLi");
        map.put("yellowPig","笨");
        map.put("pinkDog","随地尿尿");
    }

    @Override
    public String process(String requst) {
        return map.getOrDefault(requst,"查无此词");
    }

    public static void main(String[] args) throws IOException {
        TcpEchoTranslation tcpEchoTranslation = new TcpEchoTranslation(9000);
        tcpEchoTranslation.start();
    }
}
